local aozhan = fk.CreateSkill{
    name = "lingling__aozhan",
    tags = {Skill.Compulsory},
}
Fk:loadTranslationTable{
    ["lingling__aozhan"] = "鏖战",
    [":lingling__aozhan"] = "锁定技，所有角色于其出牌阶段手牌中的【桃】只能当【杀】使用，且造成伤害后其回复1点体力。",
}

aozhan:addEffect("filter", {
    anim_type = "offensive",
    card_filter = function(self, card, player, isJudgeEvent)
        return table.find(Fk:currentRoom().alive_players,function (cp)
            return cp:hasSkill(aozhan.name)
        end) and card.name == "peach" and player.phase == Player.Play and
        table.contains(player:getCardIds("h"), card.id)
    end,
    view_as = function(self, player, to_select)
        local card = Fk:cloneCard("slash", to_select.suit, to_select.number)
        card.skillName = aozhan.name
        return card
    end,
})

aozhan:addEffect(fk.Damage, {
    anim_type = "support",
    is_delay_effect = true,
    can_trigger = function (self, event, target, player, data)
        return player == target and data.card and table.contains(data.card.skillNames, aozhan.name) and player:isWounded()
    end,
    on_use = function (self, event, target, player, data)
        player.room:recover {
            who = player,
            num = 1,
            recoverBy = player,
            skillName = aozhan.name,
        }
    end,
})

aozhan:addEffect(fk.EventPhaseStart,{
    can_refresh = function (self, event, target, player, data)
        return target == player
    end,
    on_refresh = function (self, event, target, player, data)
        player:filterHandcards()
    end,
})

aozhan:addAcquireEffect(function (self, player, is_start)
    for _, cp in ipairs(player.room.alive_players) do
        cp:filterHandcards()
    end
end)
aozhan:addLoseEffect(function (self, player, is_death)
    for _, cp in ipairs(player.room.alive_players) do
        cp:filterHandcards()
    end
end)


return aozhan